﻿// Deep Earth is a community project available under the Microsoft Public License (Ms-PL)
// Code is provided as is and with no warranty – Use at your own risk
// View the project and the latest code at http://DeepEarth.codeplex.com/

using System;
using System.Collections.Generic;
using System.Linq;
using DeepEarth.Client.MapControl.Events;

namespace DeepEarth.Client.MapControl
{
    public static class MapControlEx
    {
        public static IObservable<IEvent<MapEventArgs>> GetMapLoaded(this Map map)
        {
            return Observable.FromEvent<MapEventArgs>(map.Events, "MapLoaded");
        }

        public static IObservable<IEvent<MapEventArgs>> GetMapZoomStarted(this Map map)
        {
            return Observable.FromEvent<MapEventArgs>(map.Events, "MapZoomStarted");
        }

        public static IObservable<IEvent<MapEventArgs>> GetMapZoomEnded(this Map map)
        {
            return Observable.FromEvent<MapEventArgs>(map.Events, "MapZoomEnded");
        }

        public static IObservable<IEvent<MapEventArgs>> GetMapZoomChanged(this Map map)
        {
            return Observable.FromEvent<MapEventArgs>(map.Events, "MapZoomChanged");
        }

        public static IObservable<IEvent<MapEventArgs>> GetMapViewChangedEnded(this Map map)
        {
            return Observable.FromEvent<MapEventArgs>(map.Events, "MapViewChangedEnded");
        }

        public static IObservable<IEvent<MapEventArgs>> GetMapViewChanged(this Map map)
        {
            return Observable.FromEvent<MapEventArgs>(map.Events, "MapViewChanged");
        }

        public static IObservable<IEvent<MapEventArgs>> GetMapTileSourceChanged(this Map map)
        {
            return Observable.FromEvent<MapEventArgs>(map.Events, "MapTileSourceChanged");
        }

        public static IObservable<IEvent<MapEventArgs>> GetMapRotationChanged(this Map map)
        {
            return Observable.FromEvent<MapEventArgs>(map.Events, "MapRotationChanged");
        }

        public static IObservable<IEvent<MapEventArgs>> GetMapDragBehavourChanged(this Map map)
        {
            return Observable.FromEvent<MapEventArgs>(map.Events, "MapDragBehavourChanged");
        }
    }
}